package ooday03homework;

public class RefArrayDemo {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        dogs[0]=new Dog("小黑",1,"白");
        dogs[1]=new Dog("大黑",1,"黑");
        dogs[2]=new Dog("大白",1,"白");
        for (int i=0;i<dogs.length;i++){
            System.out.println(dogs[i].name);
        }
        Chick[] chicks=new Chick[2];
        chicks[0]=new Chick("小鸡",1,"白");
        chicks[1]=new Chick("火鸡",1,"红");
        for (int j=0;j<chicks.length;j++){
            System.out.println(chicks[j].color);
            chicks[j].eat();
        }
    }

}
